<template>
<div>
  <ul v-for="i in list" :key="i.name">
    <li><router-link :to="i.url">{{i.name}}</router-link></li>
    <li>	<van-checkbox-group v-model="result">
          <van-checkbox :name="i.url">{{i.name}}</van-checkbox>
          </van-checkbox-group></li>
  </ul>

</div>
</template>

<script>
import axios from 'axios'
export default {
  name: "role",
  data(){
    return{
      userid:localStorage.getItem('userid'),
      list:[],
      result:[]
    }
  },
  methods:{
      get_role(){
        axios({url:'getrole?userid='+this.userid,method:'get'}).then(res=>{
          this.list=res.data.list
        })

      }
  },
  mounted() {
    this.get_role()
  }
}
</script>

<style scoped>

</style>